import request from '@/utils/request'

export function getElderList(params) {
  return request({
    url: '/elder/list',
    method: 'get',
    params
  })
}

export function getElderByRoom(roomId) {
  return request({
    url: `/elder/byRoom/${roomId}`,
    method: 'get'
  })
}

export function addElder(data) {
  return request({
    url: '/elder',
    method: 'post',
    data
  })
}

export function updateElder(data) {
  return request({
    url: '/elder',
    method: 'put',
    data
  })
}

export function deleteElder(id) {
  return request({
    url: `/elder/${id}`,
    method: 'delete'
  })
}
